'use strict';

const { Controller } = require('egg');

class UserController extends Controller {

  /**
   * 获取报名
  */
  async index() {
    const { ctx } = this;
    ctx.body = {
      code: 200,
      message: 'success',
    };
  }


  async login() {
    const { ctx } = this;
    const { username, password } = ctx.request.body;
    const result = await ctx.service.userService.validateLogin(username, password);

    ctx.body = result;
  }

  async getTables() {
    const { ctx } = this;
    const result = await ctx.service.baomingList.getTables();
    ctx.body = {
      code: 200,
      message: 'success',
      result,
    };
  }
}

module.exports = UserController;
